Traffic Logging into Database

This allows to record the traffic counters into database and to build a fast and scalable traffic accounting system for your users. To use feature "Traffic Logging into Database" you should:

How does the Traffic logging into Database work ?

The database table is updated with the given frequency of the flushing. Assume that the name of the database table for Traffic Logging is "traffic_table" and the current date is November 24, 2002.

  1. The value of the "ts" field is calculated. It depends on the timestamp template and the current date and time. For example, if the timestamp template is "%Y%m%d" then "ts" will be 20021124.
  2. The command "SELECT * FROM traffic_table WHERE ts=20021124" is issued and the database counters stored in the table are retrieved in a temporary counters storage.
  3. Unsaved counters since the last database update are added to the counters stored in the temporary storage.
  4. The temporary counter storage is flushed into the database